﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using eProject.Business;

namespace eProject.Web.UI.Admin
{
    public partial class CitiesManagementAddNew : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += new EventHandler(this.Page_Load);
            this.btnSubmit.ServerClick += new EventHandler(btnSubmit_Click);
            this.btnReset.ServerClick += new EventHandler(btnReset_Click);
        }
        public void btnReset_Click(object sender, EventArgs e)
        {
            txtCitiesName.Text = "";
            
        }
        public void btnSubmit_Click(object sender, EventArgs e)
        {
            string name = txtCitiesName.Text.Trim().ToString();
            Cities city = new Cities();
            city.Name = name;
            city.CreatedDate = DateTime.Now;
            city.LastUpdate = DateTime.Now;
            city.Save();
            Response.Redirect("~/Admin/CitiesManagementProgram.aspx");
        }
    }
}